package com.gagakuai.concurrent.locks;

import java.io.Serializable;

/*
 * @program: settement
 * @description: 独占锁抽象基类
 * @author: houhong
 * @create: 2022-11-20 21:17
 */
public abstract class AbstractOwnableSynchronizer implements Serializable {


    private static final long serialVersionUID = 6555430693972405278L;

    /*
     * 当前锁的线程持有者
     */
    private transient Thread exclusiveOwnerThread;

    protected AbstractOwnableSynchronizer() {
    }

    public final Thread getExclusiveOwnerThread() {
        return exclusiveOwnerThread;
    }

    public final void setExclusiveOwnerThread(Thread exclusiveOwnerThread) {
        this.exclusiveOwnerThread = exclusiveOwnerThread;
    }
}